# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: bartus <arch-user-repoᘓbartus.33mail.com>
pkgname=geogram
pkgver=1.8.3
pkgrel=1
pkgdesc="Library of geometric algorithms"
arch=('loong64' 'x86_64')
url="https://github.com/BrunoLevy/geogram"
license=('BSD')
depends=('glu' 'glfw-x11')
makedepends=('cmake' 'ninja')
source=("https://github.com/BrunoLevy/geogram/releases/download/v${pkgver}/geogram_${pkgver}.tar.gz")
sha256sums=('f75ab433fe2402bd14a165ce4081184b555b80443f17810139f244f55af56e7c')

build() {
  cd ${pkgname}_${pkgver}

  cmake \
    -Bbuild \
    -GNinja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=None \
    -DGEOGRAM_USE_SYSTEM_GLFW3=ON

  ninja -C build
}

package() {
  cd ${pkgname}_${pkgver}

  DESTDIR=${pkgdir} ninja -C build install
  install -Dm755 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
